import { PropTypes } from 'prop-types';
const ToDoLi = ({ filterList, delItem }) => {
  const getItemStyle = (status) => ({
    textDecoration: status === 0 ? 'line-through' : 'none',
  });
   
   return  filterList.map(item =>(

   
    <li key={item.id}
      className="flex justify-between items-center w-full"
      style={getItemStyle(item.status)}
    >
      <span>
        {item.name}-{item.age}
      </span>
      <span
        onClick={() => delItem(item.id)}
        className="text-red-500 cursor-pointer"
      >
        删除
      </span>
    </li>
     )
    
  );
  
};
//属性说明
// 
ToDoLi.propTypes = {
  filterList: PropTypes.array.isRequired,
  delItem: PropTypes.func.isRequired,
}
export default ToDoLi;